﻿<UserControl x:Class="Brjnk.GpxExplorer.UI.SearchPositionArgsEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:l="clr-namespace:Brjnk.GpxExplorer.Localization"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d">
    <Grid Name="mainGrd">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Text="{l:Loc searchPositionLimit}" />
        <TextBox Grid.Row="0"
                 Grid.Column="1"
                 Text="{Binding Limit}" />

        <TextBlock Grid.Row="1" Text="{l:Loc searchPositionSearchAgainLimit}" />
        <TextBox Grid.Row="1"
                 Grid.Column="1"
                 Text="{Binding SearchAgainLimit}" />

        <CheckBox Grid.Row="2"
                  Grid.ColumnSpan="2"
                  Content="{l:Loc searchPositionSearchInGaps}"
                  IsChecked="{Binding SearchInGaps}" />

        <TextBlock Grid.Row="3"
                   Grid.ColumnSpan="2"
                   Style="{StaticResource ErrorStyle}"
                   Text="{l:Loc searchPositionValidationError}">
            <TextBlock.Visibility>
                <Binding Path="LimitValidationFailed">
                    <Binding.Converter>
                        <BooleanToVisibilityConverter />
                    </Binding.Converter>
                </Binding>
            </TextBlock.Visibility>
        </TextBlock>
    </Grid>
</UserControl>